home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / pkg-config < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.5 KB  |  52 lines

  1. # bash completion for pkgconfig
  2.  
  3. have pkg-config &&
  4. _pkg_config()
  5. {
  6.     local cur prev split=false
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     _split_longopt && split=true
  12.  
  13.     case $prev in
  14.         --variable|--define-variable|--atleast-version|--atleast-pkgconfig-version| \
  15.         --exact-version|--max-version)
  16.             # argument required but no completions available
  17.             return 0
  18.             ;;
  19.         -\?|--help|--version|--usage)
  20.             # all other arguments are noop with these
  21.             return 0
  22.             ;;
  23.     esac
  24.  
  25.     $split && return 0
  26.  
  27.     if [[ "$cur" == -* ]]; then
  28.         # return list of available options
  29.         COMPREPLY=( $( compgen -W '--version --modversion \
  30.             --atleast-pkgconfig-version --libs --static \
  31.             --short-errors --libs-only-l --libs-only-other \
  32.             --libs-only-L --cflags --cflags-only-I \
  33.             --cflags-only-other --variable --define-variable \
  34.             --exists --uninstalled --atleast-version \
  35.             --exact-version --max-version --list-all --debug \
  36.             --print-errors --silence-errors --errors-to-stdout \
  37.             --print-provides --print-requires --help --usage' -- "$cur") )
  38.     else
  39.         COMPREPLY=( $( compgen -W "$( pkg-config --list-all \
  40.             2>/dev/null | awk '{print $1}' )" -- "$cur" ) )
  41.     fi
  42. } &&
  43. complete -F _pkg_config pkg-config
  44.  
  45. # Local variables:
  46. # mode: shell-script
  47. # sh-basic-offset: 4
  48. # sh-indent-comment: t
  49. # indent-tabs-mode: nil
  50. # End:
  51. # ex: ts=4 sw=4 et filetype=sh
  52.